/*
 *  ball.h
 *  fadeout_simulator
 *
 *  Created by 真鍋 大度 on 11/02/26.
 *  Copyright 2011 Rhizomatiks. All rights reserved.
 *
 */

#pragma once

#include "ofMain.h"
#include "ofxOpenCv.h"
#include "ptclSendData.h"
#include "checkPoint.h"
class ball{
public:
	
	ball(){
		bActive = false;
	}
	~ball(){
	}
	
	virtual void setup(int _myID, vector<checkPoint*> & _checkPoints);

	void passInColorPixels(unsigned char * _colorpixels){
		currentColorPixels = _colorpixels;
	}
	virtual void update(unsigned char * _colorpixels);
	void updateWithAge(unsigned char * _colorpixels, int _myage);	
//	virtual void update();	
	virtual void draw();
	virtual void incrementAge();	
	void activate();
	void inactivate();
	void sendOSC();
	void sendCheckPoint();
	int w,h;
	int x,y;
	int checkPointID;
	float speed;
	ofVec2f pos;
	bool bAmIDead;
	int age;
	int ratio;
	ofColor col;
	unsigned char * currentColorPixels;
//	ofxCvColorImage currentColorImage;
	int myID;
	bool bActive;
	vector<checkPoint*> checkPoints;
};